home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C++ / Applications / ResAnomaly 1.2 / Copland ResourcesLibƒ / System8Resources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-24  |  3.9 KB  |  103 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        System8Resources.h
  3.  
  4.     Contains:    The System 7 resource manager redefined in
  5.                     terms of the System 8 Resource Manager.
  6.     
  7.     Version:    1.0
  8.     
  9.     Copyright:    ©1995 Apple Computer.  All Rights Reserved.
  10. */
  11.  
  12. #include <Resources.h>
  13.  
  14. #if (!SystemEightOrLater)
  15.  
  16. typedef short ResFileRefNum;
  17.  
  18. typedef short ResID;
  19.  
  20. typedef short ResAttributes;
  21.  
  22. typedef short ResFileAttributes;
  23.  
  24. enum {
  25.     kResFileReadOnlyPermission    = 100,
  26.     kResFileReadWriteExclusivePermission = 101
  27. };
  28.  
  29. typedef UInt32 ResFilePermissions;
  30.  
  31. // * these can't be supported under the System 7 resource manager
  32. //    without hacks which may not work under the System 7.5.3 res manager.
  33. //extern OSStatus RMRemoveResFileFromSearchPath(ResFileRefNum refNum);
  34. //extern OSStatus RMAddResFileToSearchPath(ResFileRefNum refNum);
  35.  
  36. // *these functions can't be supported without some emulation
  37. //    of the Scarecrow filesystem, which I'm reluctant to do
  38. //    without being paid.  I've create FileSpec-using equivalents,
  39. //  below.
  40.  
  41. //extern OSStatus RMCreateResFile(FSObjectSpecification *specification);
  42. //extern OSStatus RMOpenResFile(FSObjectSpecification *specification, ResFilePermissions permissions, Boolean resLoad, ResFileRefNum *refNum);
  43.  
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47.  
  48. // * these two are __not__ part of the System 8 Resource Manager - see above
  49. extern OSStatus RMFSpCreateResFile(FSSpec *inSpec, OSType creator, OSType fileType, ScriptCode scriptTag);
  50. extern OSStatus RMFSpOpenResFile(FSSpec *specification, ResFilePermissions permissions, Boolean resLoad, ResFileRefNum *refNum);
  51.  
  52. extern OSStatus RMCloseResFile(ResFileRefNum refNum);
  53. extern OSStatus RMUpdateResFile(ResFileRefNum refNum);
  54.  
  55. extern OSStatus RMUseResFile(ResFileRefNum refNum);
  56. extern OSStatus RMCurResFile(ResFileRefNum *refNum);
  57. extern OSStatus RMHomeResFile(Handle theResource, ResFileRefNum *refNum);
  58.  
  59. extern OSStatus RMAddResource(Handle theData, ResType theType, ResID theID, ConstStr255Param name);
  60. extern OSStatus RMRemoveResource(Handle theResource);
  61.  
  62. extern OSStatus RMCountTypes(Boolean oneDeep, UInt32 *count);
  63. extern OSStatus RMGetIndexedType(UInt32 index, Boolean oneDeep, ResType *theType);
  64. extern OSStatus RMCountResources(ResType theType, Boolean oneDeep, UInt32 *count);
  65.  
  66. extern OSStatus RMGetIndexedResource(ResType theType, UInt32 index, Boolean oneDeep, Boolean resLoad, Handle *handle);
  67. extern OSStatus RMGetResource(ResType theType, ResID theID, Boolean oneDeep, Boolean resLoad, Handle *handle);
  68. extern OSStatus RMGetNamedResource(ResType theType, ConstStr255Param name, Boolean oneDeep, Boolean resLoad, Handle *handle);
  69.  
  70. extern OSStatus RMLoadResource(Handle theResource);
  71.  
  72. extern OSStatus RMReleaseResource(Handle theResource);
  73. extern OSStatus RMDetachResource(Handle theResource);
  74.  
  75. extern OSStatus RMChangedResource(Handle theResource);
  76.  
  77. extern OSStatus RMWriteResource(Handle theResource);
  78. extern OSStatus RMSetResourceSize(Handle theResource, SInt32 newSize);
  79.  
  80. extern OSStatus RMUniqueID(ResType theType, Boolean oneDeep, ResID *idPtr);
  81. extern OSStatus RMGetResAttributes(Handle theResource, ResAttributes *attributes);
  82.  
  83. // *    System 7 SetResInfo doesn't support setting the type of
  84. //                resources, so we don't here either.
  85.  
  86. extern OSStatus RMGetResInfo(Handle theResource, ResType *typePtr, ResID *idPtr, Str255 name);
  87. extern OSStatus RMSetResInfo(Handle theResource, ResType /* theType */, ResID theID, ConstStr255Param name);
  88. extern OSStatus RMSetResAttributes(Handle theResource, ResAttributes attrs);
  89.  
  90. extern OSStatus RMReadPartialResource(Handle theResource, UInt32 offset, void *buffer, UInt32 count);
  91. extern OSStatus RMWritePartialResource(Handle theResource, UInt32 offset, const void *buffer, UInt32 count);
  92.  
  93. extern OSStatus RMGetResourceSize(Handle theResource, SInt32 *size);
  94. extern OSStatus RMSetResErrProc(ResErrUPP proc);
  95.  
  96. extern OSStatus RMSetResFileReadOnlyState(ResFileRefNum refNum, Boolean isReadOnly);
  97. extern OSStatus RMGetResFileReadOnlyState(ResFileRefNum refNum, Boolean *isReadOnly);
  98.  
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102.  
  103. #endif